package com.etone.smartAudit.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.etone.smartAudit.domain.PUumUserinfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel(value = "PUumUserinfoVO", description = "组织人员视图")
public class PUumOrgVO implements Serializable {
    //    select org.ouName,user.fullName from p_uum_userinfo user left join p_uum_organizationinfo org
//    on user.departmentID=org.OUGUID

    @ApiModelProperty(value = "组织ID")
    private String oUGUID;

    @ApiModelProperty(value = "父组织ID")
    private String parentOUGUID;

    @ApiModelProperty(value = "组织类型(UN: 公司 UM: 部门,TD:团队)。如果")
    private String orgTypeID;


    @ApiModelProperty(value = "组织名称(portal)/ 团队名称")
    private String oUName;


    @ApiModelProperty(value = "组织全名(portal)")
    private String oUFullName;

    @ApiModelProperty(value = "组织中的 DN(portal)")
    private String orgDN;

    @ApiModelProperty(value = "所属地区(省公司)")
    private String region;

    @ApiModelProperty(value = "组织层次(portal)")
    private Integer OULevel;

    @ApiModelProperty(value = "公司id")
    private String companyId;

    @ApiModelProperty(value = "公司")
    private String company;

    @ApiModelProperty(value = "子集")
    private List<PUumOrgVO> children;


    @ApiModelProperty(value = "是否拥有用户")
    private Boolean hasUser = false;

    @ApiModelProperty(value = "用户子集")
    private List<PUumUserinfoVO> users;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        PUumOrgVO other = (PUumOrgVO) obj;
        if (other.getOUGUID() == null) {
            return false;
        }
        if (oUGUID == null) {
            if (other.oUGUID != null) {
                return false;
            }
        } else if (!oUGUID.equals(other.oUGUID)) {
            return false;
        }
        return true;
    }

}
